<?php
include_once 'config.inc.php';
include_once 'mysql.inc.php';
include_once 'tool.inc.php';

$link=connect();
$query="select * from admin_info where id=1";
$result_info=execute($link, $query);
$data_info=mysqli_fetch_assoc($result_info);

if(isset($_COOKIE['youyou']['name']) && isset($_COOKIE['youyou']['pw'])){
	$username= $_COOKIE['youyou']['name'];
}else{
	skip('login.php', 'error', '您还没登录不能访问会员中心！');
	exit;
}
?>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
	<meta name="author" content="悠游网" />
	<meta name="copyright" content="悠游网络科技股份有限公司" />
	<title><?php echo $template['title'] ?> - <?php echo $data_info['title']?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name='keywords' content='<?php echo $data_info['keywords']?>' />
	<meta name='description' content='<?php echo $data_info['description']?>' />
	<link href="img/index/logo.gif" rel="shortcut icon"/>
	<link rel="stylesheet" href="css/style.css" type="text/css" />
	<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
</head>
<body>
<div id="userinfo">
	<div class="header">
		<div class="navTop">
			<div class="top_left">
				<a href="index.php"><img src="img/index/logo.gif"  border="0px" alt="悠游网" title="悠游网" /></a>
				<span>&nbsp;-&nbsp;会员中心</span>
			</div>
			<div class="top_right">
				<span>欢迎您，<?php	echo $username;?>
				</span>
				<span>[<a href="index.php">网站首页</a>]</span>
				<form action="logout.php" method="post">
					&nbsp;<span><input type="submit" class="logout" value="[注销]" name="submit" /></span>
				</form>
			</div>
		</div>
	</div>

	<div class="main">
		<div class="left">
			<!-- 左侧菜单开始 -->

			<div class="panel-group" id="accordion">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a href="javascript:;" class='title'>我的悠游</a>
						</h4>
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a href="#collapseOne" data-toggle="collapse">会员中心</a>
							<em></em>
						</h4>
					</div>
					<div id="collapseOne" class="panel-collapse collapse in">
						<div class="panel-body">
							<ul class="list_01">
								<li><a target="content"<?php if(basename($_SERVER['SCRIPT_NAME'])=='information.php'){echo 'class="active"';}?> class="list_menu" href="information.php">我的信息</a></li>
								<li><a target="content"<?php if(basename($_SERVER['SCRIPT_NAME'])=='updataPw.php'){echo 'class="active"';}?> class="list_menu" href="updataPw.php">修改密码</a></li>
								<li><a target="content"<?php if(basename($_SERVER['SCRIPT_NAME'])=='Mymessage.php'){echo 'class="active"';}?> class="list_menu" href="Mymessage.php">我的留言</a></li>
								<li><a target="content"<?php if(basename($_SERVER['SCRIPT_NAME'])=='comment.php'){echo 'class="active"';}?> class="list_menu" href="comment.php">我的点评</a></li>
								<li><a href="javascript:;">安全中心</a></li>
							</ul>
						</div>
					</div>
				</div>

				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a href="#collapseTwo" data-toggle="collapse">个人应用</a>
							<em></em>
						</h4>
					</div>
					<div id="collapseTwo" class="panel-collapse collapse in">
						<div class="panel-body">
							<ul class="list_01">
								<li><a target="content" class="list_menu" href="javascript:;">我的订单</a></li>
								<li><a target="content" href="javascript:;" class="list_menu">供求发布</a></li>
							</ul>
						</div>
					</div>
				</div>

				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a href="#collapseThree" data-toggle="collapse">服务中心</a>
							<em></em>
						</h4>
					</div>
					<div id="collapseThree" class="panel-collapse collapse">
						<div class="panel-body">
							<ul class="list_01">
								<li><a target="content" href="javascript:;" class="list_menu">机票预约</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<!-- 左侧菜单结束 -->
		</div>
	
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript">
		var oTitle=document.getElementsByClassName('panel-title');
		var aA=document.getElementById('accordion').getElementsByClassName('list_menu');

		var flag=true;
		for(var i=0; i<oTitle.length; i++){
			oTitle[i].onclick=function(){
				if(flag){
					var em=this.getElementsByTagName('em')[0];
					em.style.background="url(img/orderCenter.png) -3px -218px";
					flag=false;
				}else{
					var em=this.getElementsByTagName('em')[0];
					em.style.background="url(img/orderCenter.png) 0 -291px";
					flag=true;
				}
			}
		}

		for(var i=0; i<aA.length; i++){
			aA[i].onclick=function(){
				for(var i=0; i<aA.length; i++){
					aA[i].classList.remove('active');
				}
				this.classList.add('active');
			}
		}

		// var logout=document.getElementsByClassName('logout')[0];
		// logout.onclick=function(){
		// 	removeCookie('youyou[name]');
		// 	removeCookie('youyou[pw]');
		// }

		function removeCookie(name)
		{
			setCookie(name, '1', -3600);
		}
		function setCookie(name, value, iDay)
		{
			var oDate=new Date();

			oDate.setDate(oDate.getDate()+iDay);

			document.cookie=name+'='+value+';expires='+oDate;
		}

	</script>